<?php
/*
===========================================================================

  Copyright (c) 2010-2012 DSPWeb Development Team

  This program is free software: you can redistribute it and/or modify
  it under the terms of the GNU General Public License as published by
  the Free Software Foundation, either version 3 of the License, or
  (at your option) any later version.

  This program is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  GNU General Public License for more details.

  You should have received a copy of the GNU General Public License
  along with this program.  If not, see http://www.gnu.org/licenses/

  This file is part of DSPWeb source code

===========================================================================
*/

if ($sql->num_rows($motdq) > 0) {
$output .= '
<table width="85%" border="0" style="border: 1px solid #c0c0c0;" cellpadding=0 cellspacing=0>
  <tr>
    <td style="background-color: #F1F3F5; border-bottom: 1px solid #c0c0c0; padding: 5px; font-weight: bold; font-size: 12px; color: #3f6fbc;">Message of The Day</td>
  </tr>
  <tr>
    <td style="padding: 10px;">
      <span style="text-align: left; padding: 5px; font-size: 12px;">'.$motd['content'].'
	  </td>
  </tr>
</table>';
}
$output .= '
<br /><table width="85%" border="0" style="border: 1px solid #c0c0c0;" cellpadding=0 cellspacing=0>
  <tr>
    <td style="background-color: #F1F3F5; border-bottom: 1px solid #c0c0c0; padding: 5px; font-weight: bold; font-size: 12px; color: #3f6fbc;">News and Information</td>
  </tr>
  <tr>
    <td style="padding: 10px;"><center>';
	if ($sql->num_rows($newsq) > 0) {
		while ($news = $sql->fetch_array($newsq)) {
			$output .= '
	<table width="100%" border="0" style="border: 1px solid #c0c0c0;" cellpadding=0 cellspacing=0>
        <tr>
          <td style="background-color: #f1f3f5; border-bottom: 1px solid #c0c0c0; font-size: 10px; font-weight: bold; padding: 5px;">'.$news['title'].' - '.date('m/d/Y H:iA',$news['post_date']).' by <em>'.getAccountName($news['poster']).'</em></td>
        </tr>
        <tr>
          <td style="padding: 5px; font-size: 12px;">'.$news['content'].'</td>
        </tr>
      </table><br />';
		}
	}
	else {
		$output .= '<span style="text-align: left; font-size: 12px;">No news has been posted.</span>';
	}
	$output .= '
      
	  </table>
    </center></td>
  </tr>
</table></center>';
?>